<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<script type="text/javascript" src="../skins/js/autocomplete.js"></script>
<script type="text/javascript" src="../skins/js/jquery-1.3.2.min.js"></script>
<link rel="stylesheet" type="text/css"
	href="../skins/css/autocomplete.css">
<script type="text/javascript">
$(document).ready(function(){
	new Autocomplete("search_field", function() {
		if ( this.value.length < 1 && this.isNotClick ) 
			return ;
		return "search_facet?q=" + this.value;
	});
});
function search(){
	var value = $("#search_field").val();
	var url = "search_content?q="+ escape(value);
	$.get(url, function(data) {
		if(data != null && data != ''){
		  $('#results').html(data);
		}
	});
}
</script>
</head>
<body>
	<h1>Exemplo de auto complete em Ajax</h1>
	<input type="text" name="search_field" id="search_field" size="70"
		onclick="this.value='';" />
	<input type="button" value="Search" onclick="search();" />
	<div id="results"></div>
</body>
</html>
